package com.easyadmin.modules.stock.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.easyadmin.common.web.domain.request.PageDomain;
import org.springframework.stereotype.Service;
import com.easyadmin.modules.stock.mapper.SysStockDomesDevelopHistoryDao;
import com.easyadmin.modules.stock.domain.SysStockDomesDevelopHistory;
import com.easyadmin.modules.stock.service.ISysStockDomesDevelopHistoryService;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * 国内经济发展Service业务层处理
 *
 * @author jmys
 * @date 2025-10-02
 */
@Service
public class SysStockDomesDevelopHistoryServiceImpl extends ServiceImpl<SysStockDomesDevelopHistoryDao, SysStockDomesDevelopHistory> implements ISysStockDomesDevelopHistoryService {

    @Resource
    private SysStockDomesDevelopHistoryDao sysStockDomesDevelopHistoryDao;

    /**
     * 查询国内经济发展
     *
     * @param sysStockDomesDevelopHistory 国内经济发展
     * @param pageDomain
     * @return 国内经济发展 分页集合
     */
    @Override
    public PageInfo<SysStockDomesDevelopHistory> selectSysStockDomesDevelopHistoryPage(SysStockDomesDevelopHistory sysStockDomesDevelopHistory, PageDomain pageDomain) {
        PageHelper.startPage(pageDomain.getPage(), pageDomain.getLimit());
        List<SysStockDomesDevelopHistory> data = sysStockDomesDevelopHistoryDao.selectSysStockDomesDevelopHistoryList(sysStockDomesDevelopHistory);
        return new PageInfo<>(data);
    }

    @Override
    public Boolean remove(String id) {
        return sysStockDomesDevelopHistoryDao.deleteById(id) > 0;
    }

    @Override
    public boolean update(SysStockDomesDevelopHistory sysStockDomesDevelopHistory) {
        return sysStockDomesDevelopHistoryDao.updateById(sysStockDomesDevelopHistory) > 0;
    }

    @Override
    @Transactional
    public boolean batchRemove(String[] ids) {
        for (String id : ids) {
            sysStockDomesDevelopHistoryDao.deleteById(Integer.parseInt(id));
        }
        return true;
    }

}
